package com.wjk.cms.auth;

import com.wjk.cms.util.ContextUtil;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;

public class AuthScene {

    /**
     * 互联网营销师
     */
    public static final String HLWYXS = "HLWYXS";

    public static String get(String defaultValue) {
        String scene = get();
        return StringUtils.isEmpty(scene) ? defaultValue : scene;
    }

    public static String get() {
        HttpServletRequest request = ContextUtil.getHttpServletRequest();
        if (request == null) {
            return null;
        }
        return request.getHeader("scene");
    }

    public static String getExt() {
        HttpServletRequest request = ContextUtil.getHttpServletRequest();
        if (request == null) {
            return null;
        }
        return request.getHeader("scene_ext");
    }

}
